<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'app',
  components: {
  },
  computed: {
    ...mapGetters([
      'loginUserPermission'
    ])
  },
  watch: {
    $route (to, from) {
      const routerPath = to.name
      this.loginUserPermission.forEach((element, index) => {
        if (routerPath.indexOf(element.value) > -1) {
          this.$store.dispatch('setSliderMenu', this.loginUserPermission[index].children)
        }
      })
    }
  },
  mounted () {

  }
}
</script>

<style lang="scss">
@import './styles/index.scss'; // 全局自定义的css样式
@import './styles/styles.scss';
@import './styles/page.scss';
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
</style>
